﻿<!DOCTYPE html>
<html>
<head>
    <title>栏目树</title>
    $css()$js()
</head>
<body>

    <div class="tree" id="menu_tree" style="padding: 15px 0 15px 20px; background: #FFF;border-top:solid 1px #D0D0D0"></div>

    <script type="text/javascript">

        var menuTreeEle = jr.$('menu_tree');
        if (menuTreeEle.parentNode.nodeName === 'DIV') {
            menuTreeEle.parentNode.style.cssText += 'height: 100%; overflow: auto;';
            menuTreeEle.parentNode.parentNode.style.cssText += 'height: 100%;';
        }

        
        function showArchives(src,d,t){
            d=jr.toJson(d);
            parent.FwTab.show(t, '?module=archive&action=list&category.id=' + d.cid, '1_996_' + d.cid);
            // 设置选择背景
            var nodeLinks = jr.dom.getsByClass(menuTreeEle, 'node');
            jr.each(nodeLinks, function(i, e) {
                if (e.nodeName === 'DIV') {
                    e.style.backgroundColor='';
                }
            });
            src.parentNode.style.backgroundColor="#FBEC88";
        };

        jr.tree.load(menuTreeEle.id,${tree}, '/public/assets/tree/',showArchives);
        var nodeLinks = jr.dom.getsByClass(menuTreeEle,'node');
        jr.each(nodeLinks,function(i,e){
            if(e.nodeName=='A'){
                if(e.innerHTML.length>18){
                    e.innerHTML = '<span title="'+e.innerHTML + '">'
                        + e.innerHTML.substring(0,18)
                        + '..</span>';
                }
            }
        });
    </script>

</body>
</html>